﻿using System;
using System.Collections.Generic;
using System.Text;

//方法不能独立于类的形式存在 
namespace _008_009_方法的定义_调用与调试
{
    internal class Program
    {
        static void Main(string[] args)
        {

            Calculator calculator = new Calculator();
            double result = calculator.GetConeVolune(100.0,200.0);
            Console.WriteLine(result);
            //Console.WriteLine(calculator.GetCricleAre(1));

        }
    }


    class Calculator {
    
    public double GetCricleAre(double r)
        {
            return Math.PI*r*r;
        }

        public double GetCylinderVolume(double r, double h)
        {
            double a = GetCricleAre(r);
            return a * h;
        }

        public double GetConeVolune(double r,double h)
        {
            return GetCylinderVolume(r,h)/3;
        }
    }

   
}
